package com.touzhijia.authority.domain.dto.response;

import com.touzhijia.authority.domain.entity.Permission;
import com.touzhijia.authority.domain.entity.Role;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 作者： lzw<br/>
 * 创建时间：2018-03-23 11:51 <br/>
 */
@NoArgsConstructor
@Data
public class RolePermissionAddRes implements Serializable {

    private Role role;

    private Permission permission;

    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 权限字符串
     */
    private String permissionStr;

    public RolePermissionAddRes(Role role, Permission permission) {
        this.role = role;
        this.permission = permission;
        this.permissionStr = permission.getPermission();
        this.roleName = role.getName();
    }
}
